package com.zrf.poi.word;

import org.apache.poi.POIXMLDocumentPart;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFPictureData;

import java.io.File;
import java.io.FileInputStream;

/**
 * @author zhouruifeng
 * @date 2018/5/21
 */
public class WordTableDemo {
    public static void main(String[] args) throws Exception {
        String filePath = "";
        File file = new File(filePath);
        XWPFDocument document = new XWPFDocument(new FileInputStream(file));
        POIXMLDocumentPart poixmlDocumentPart = document.getTableArray(0).getRow(0).getCell(0)
                .getParagraphs().get(0).getDocument();
        if (poixmlDocumentPart instanceof XWPFPictureData) {
            XWPFPictureData xwpfPictureData = (XWPFPictureData)poixmlDocumentPart;
            xwpfPictureData.getData();
        }
    }
}
